package cn.jhg.account.dao;

import javax.annotation.Resource;

import org.bson.Document;
import org.bson.types.ObjectId;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Repository;

import cn.jhg.account.entity.EquipmentProperty;




@Repository
public class EMPropertyDaoImpl implements EMPropertyDao {
	
	private org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(EMPropertyDaoImpl.class);
	
	@Resource
	private MongoTemplate mongoTemplate;

	@Override
	public EquipmentProperty getProperty(ObjectId id) {
		EquipmentProperty prop = null;
		
		Document document = mongoTemplate.findById(id, Document.class, "equipment_property");
		
		prop = (EquipmentProperty)document.get("propertyValue");
		
		return prop;
	}

	@Override
	public int setProperty(ObjectId id, EquipmentProperty val) {
		// TODO Auto-generated method stub
		return 0;
	}

}
